Skip to content

Conversation

@Lash-L
Copy link
Collaborator

@Lash-L Lash-L commented Dec 3, 2025

match what we did in the old api

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the wrong index was used to retrieve the last (most recent) clean record. The change corrects the index from self.records[-1] (oldest record) to self.records[0] (newest record), aligning with the implementation in the legacy V1 API at roborock/version_1_apis/roborock_client_v1.py:281.

  • Changed clean record retrieval to use the first element (index 0) instead of the last element (index -1) of the records list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

self.last_clean_record = None
return
last_record_id = self.records[-1]
last_record_id = self.records[0]
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The corresponding test in tests/devices/traits/v1/test_clean_summary.py needs to be updated to match this fix. Line 96 of the test expects the call to be made with params=[1734458038] (the last element in the records list), but with this change it should now expect params=[1756848207] (the first element). Additionally, the test data in CLEAN_RECORD_DATA should be updated to have a begin value that matches the first record ID (1756848207) instead of the current inconsistent value (1738864366).

Copilot uses AI. Check for mistakes.
@Lash-L Lash-L merged commit f129603 into main Dec 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants